/**
* <p> title �� SpecialtyServiceImpl.java</p>
* <p> package �� cn.edu.hit.education.service</p>
* <p> description ��TODO</p>
* <p> copyright �� ��������ҵ��ѧ(C) 2019</p>
* <p> company �� ��������ҵ��ѧAS&MT</p>
* <p> author �� ��ѩ�� jinxuesong@163.com</p>
* <p> date �� 2021��4��21�� ����4:37:51</p>
* <p> version �� v1.0 </p>
*
* Modification  History:
* Date         Author        Version        Discription
* -----------------------------------------------------------------------------------
* 2021��4��21��       ��ѩ��          1.0             1.0
* Why & What is modified: <�޸�ԭ������>
*/
package cn.edu.hit.education.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.hit.education.dao.SpecialtyMapper;
import cn.edu.hit.education.pojo.Specialty;
import cn.edu.hit.education.pojo.SpecialtyExample;

/**
 * <p> classname �� SpecialtyServiceImpl</p>
 * <p> description ��TODO</p>
 * <p> author �� ��ѩ�� jinxuesong@163.com</p>
 * <p> date �� 2021��4��21�� ����4:37:51</p>
 */
@Service
public class SpecialtyServiceImpl implements ISpecialtyService {

	@Autowired
	SpecialtyMapper specialtyMapper;

	@Override
	public int insert(Specialty specialty) {
		// TODO �Զ����ɵķ������
		return specialtyMapper.insert(specialty);
	}

	/* (�� Javadoc) 
	 * <p>Title: deleteByPrimaryKey</p> 
	 * <p>Description: </p> 
	 * @param id
	 * @return 
	 * @see cn.edu.hit.education.service.ISpecialtyService#deleteByPrimaryKey(int) 
	 */

	@Override
	public int deleteByPrimaryKey(int id) {
		// TODO �Զ����ɵķ������
		return specialtyMapper.deleteByPrimaryKey(id);
	}

	/* (�� Javadoc) 
	 * <p>Title: update</p> 
	 * <p>Description: </p> 
	 * @param specialty
	 * @return 
	 * @see cn.edu.hit.education.service.ISpecialtyService#update(cn.edu.hit.education.pojo.Specialty) 
	 */

	@Override
	public int update(Specialty specialty) {
		// TODO �Զ����ɵķ������
		return specialtyMapper.updateByPrimaryKey(specialty);
	}

	/* (�� Javadoc) 
	 * <p>Title: queryAllSpecialty</p> 
	 * <p>Description: </p> 
	 * @return 
	 * @see cn.edu.hit.education.service.ISpecialtyService#queryAllSpecialty() 
	 */

	@Override
	public List<Specialty> queryAllSpecialty() {
		// TODO �Զ����ɵķ������
		SpecialtyExample example = new SpecialtyExample();
		SpecialtyExample.Criteria criteria = example.createCriteria();
		criteria.andIdGreaterThan(0);
		
		return specialtyMapper.selectByExample(example);
	}

	/* (�� Javadoc) 
	 * <p>Title: queryAllSpecialtiesByCollegeId</p> 
	 * <p>Description: </p> 
	 * @param collegeId
	 * @return 
	 * @see cn.edu.hit.education.service.ISpecialtyService#queryAllSpecialtiesByCollegeId(int) 
	 */

	@Override
	public List<Specialty> querySpecialtiesByCollegeId(int collegeId) {
		// TODO �Զ����ɵķ������
		SpecialtyExample example = new SpecialtyExample();
		SpecialtyExample.Criteria criteria = example.createCriteria();
		criteria.andCollegeIdEqualTo(collegeId);
		
		return specialtyMapper.selectByExample(example);
	}

	/* (�� Javadoc) 
	* <p>Title: queryByPrimaryKey</p> 
	* <p>Description: </p> 
	* @param id
	* @return 
	* @see cn.edu.hit.education.service.ISpecialtyService#queryByPrimaryKey(int) 
	*/
	
	@Override
	public Specialty queryByPrimaryKey(int id) {
		// TODO �Զ����ɵķ������
		return specialtyMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<Specialty> queryRelativeSpecialty(List<Integer> ids) {
		
		return specialtyMapper.queryRelativeSpecialty(ids);
	}

}
